"""
example02 - 元组 ---> 不可变的容器

Author: Administrator
Date: 2024/1/10
"""

fruits1 = ('apple', 'banana', 'orange', 'grape')
print(type(fruits1))
# 重复运算
print(fruits1 * 3)
# 成员运算
print('apple' in fruits1)
print('orange' not in fruits1)
# 合并运算
fruits2 = ('pitaya', 'litchi')
fruits3 = fruits1 + fruits2
print(fruits3)
# 索引和切片
print(fruits3[4], fruits3[-1])
# fruits3[4] = 'shit'
print(fruits3[1:4])
print(fruits3[1:4:2])
print(fruits3[::-1])